package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id        uint           `gorm:"column:id;type:bigint(20);primaryKey;not null;" json:"id"`
	Name      string         `gorm:"column:name;type:varchar(255);comment:姓名;not null;" json:"name"`           // 姓名
	Mobile    string         `gorm:"column:mobile;type:char(11);comment:手机号;not null;" json:"mobile"`          // 手机号
	Password  string         `gorm:"column:password;type:varchar(255);comment:密码;not null;" json:"password"`   // 密码
	Sex       string         `gorm:"column:sex;type:varchar(255);comment:性别;not null;" json:"sex"`             // 性别
	Email     string         `gorm:"column:email;type:varchar(255);comment:邮箱;not null;" json:"email"`         // 邮箱
	Address   string         `gorm:"column:address;type:varchar(255);comment:籍贯;not null;" json:"address"`     // 籍贯
	Education string         `gorm:"column:education;type:varchar(255);comment:学历;not null;" json:"education"` // 学历
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (u *User) TableName() string {
	return "user"
}
